package com.youpingou.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.youpingou.domain.Sku;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SkuMapper extends BaseMapper<Sku> {
    @Select("select * from tb_sku where spu_id = #{spuId}")
    public List<Sku> findSkuListBySpuId(Integer spuId);

    @Select("select count(*) from tb_order_good og,tb_order o  where og.sku_id = #{skuId} and og.sn = o.sn and o.status>=4")
    public Integer findSellCountBySkuId(Integer skuId);


}
